namespace Laywer_CRM.Model.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class Database_creation : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.ClientMasters",
                c => new
                    {
                        ID = c.Guid(nullable: false, identity: true),
                        FirstName = c.String(),
                        MiddleName = c.String(),
                        State = c.String(),
                        City = c.String(),
                        ZipCode = c.String(),
                        PanCard = c.String(),
                        TinNumber = c.String(),
                        BillingAddress = c.String(),
                        CreaditLimit = c.String(),
                        Email = c.String(),
                    })
                .PrimaryKey(t => t.ID);
            
            CreateTable(
                "dbo.Cases",
                c => new
                    {
                        ID = c.Guid(nullable: false, identity: true),
                        Date = c.DateTime(nullable: false),
                        CaseDescription = c.String(),
                        AmountReceived = c.Decimal(nullable: false, precision: 18, scale: 2),
                        NextHearing = c.DateTime(nullable: false),
                        CaseType_ID = c.Int(),
                    })
                .PrimaryKey(t => t.ID)
                .ForeignKey("dbo.CaseTypes", t => t.CaseType_ID)
                .Index(t => t.CaseType_ID);
            
            CreateTable(
                "dbo.CaseTypes",
                c => new
                    {
                        ID = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                    })
                .PrimaryKey(t => t.ID);
            
            CreateTable(
                "dbo.DocumentRequireds",
                c => new
                    {
                        ID = c.Guid(nullable: false, identity: true),
                        Name = c.String(),
                        CaseType_ID = c.Int(),
                    })
                .PrimaryKey(t => t.ID)
                .ForeignKey("dbo.CaseTypes", t => t.CaseType_ID)
                .Index(t => t.CaseType_ID);
            
        }
        
        public override void Down()
        {
            DropIndex("dbo.DocumentRequireds", new[] { "CaseType_ID" });
            DropIndex("dbo.Cases", new[] { "CaseType_ID" });
            DropForeignKey("dbo.DocumentRequireds", "CaseType_ID", "dbo.CaseTypes");
            DropForeignKey("dbo.Cases", "CaseType_ID", "dbo.CaseTypes");
            DropTable("dbo.DocumentRequireds");
            DropTable("dbo.CaseTypes");
            DropTable("dbo.Cases");
            DropTable("dbo.ClientMasters");
        }
    }
}
